﻿using System.Collections.Generic;
using KingRoad.EPM.CompletionMaterialsDAL.ScmAttachsfilesService;
using KingRoad.EPM.CompletionMaterialsEntity.Model;

namespace KingRoad.EPM.CompletionMaterialsBLL.UIRules
{
    /// <summary> 
    /// 客户端业务处理类。 
    /// 文件生成时间 2017/8/7 20:34:15
    /// </summary> 
    public class ScmAttachsfilesUIRule
    {
        private readonly IScmAttachsfilesService _scmAttachsfilesService;


        public ScmAttachsfilesUIRule()
        {
            if (_scmAttachsfilesService == null)
                _scmAttachsfilesService = new ScmAttachsfilesService();
        }
        
        /// <summary> 
        /// construct function... 
        /// </summary> 
        public ScmAttachsfilesUIRule(IScmAttachsfilesService  scmAttachsfilesService)
        {
           _scmAttachsfilesService=scmAttachsfilesService;
        }

        public bool InsertObjs(List<ScmAttachsfilesInfo> objs)
        {
            objs.ForEach(t =>
            {
                _scmAttachsfilesService.InsertEntity(t);
            });
            return true;
        }

        public bool DeleteObjsByPkIdAndFileName(string pkId,string fileName)
        {
           return _scmAttachsfilesService.DeleteObjsByPkIdAndFileName(pkId, fileName);
        }
    }
}
